<?php

namespace pos\modules\admin\controllers;

use pos\extensions\ApiBaseController;
use pos\services\admin\AdminService;

class AdminController extends ApiBaseController
{
   
    // 个人中心数据统计
    public function actionLogin()
    {
        $params = \Yii::$app->request->post();
        $rules = [
            [['phone','pass'], 'required', 'message' => '{attribute}属必填项'],
        ];
        $validate = $this->validateParams($params, $rules);
        if ($validate) {
            return $this->jsonError($validate);
        }
        return AdminService::login($this->params);
    }


    public function actionInfo()
    {
        $params = \Yii::$app->request->post();
        $rules = [
        ];
        $validate = $this->validateParams($params, $rules);
        if ($validate) {
            return $this->jsonError($validate);
        }
        return AdminService::info($this->params);
    }



    
}